using System;
using System.Collections.Generic;
using Mahjong.UI;


namespace Mahjong.UI
{
public class Base
{   
    private Manager manager;
    private BaseUI baseUI;
    public void SetManager(Manager manager)
    {
    this.manager = manager;
    }
    public void SetBaseUI(BaseUI baseUI)
    {
        this.baseUI = baseUI;
        baseUI.SetBaseLogic(this);
    }
    /*应该放进data里
    public void StorePlayerInformation(Dictionary<int, string> playerInfo)
    {// 存储玩家信息的
        
    }
    */
    //检查玩家输入完整性的 
    public bool CheckPlayerInputCompleteness(Dictionary<int, string> inputInfo)
    {
        
        return true;/*暂时默认完整*/
    }

    //处理加载游戏大厅界面的请求
    public void LoadLobbySceneRequested()
    {
        Console.WriteLine("Manager: Loading Lobby Scene requested.");
        Dictionary<int, string> playerInfo = new Dictionary<int, string>
        {
            { 0, "Player 0" },
            { 1, "Player 1" },
            { 2, "Player 2" },
            { 3, "Player 3" }
        };
        baseUI.LoadLobbyScene(playerInfo);
        OnLobbySceneLoaded();
    }
    //通知Manager游戏大厅界面已经加载完毕
    public bool OnLobbySceneLoaded()
    {
        Console.WriteLine("Manager: Lobby Scene loaded.");
        return true;
    }

    //处理加载牌桌界面的请求
    public void LoadTableSceneRequested()
    {
        Console.WriteLine("Manager: Loading Table Scene requested.");
        Dictionary<int, string> playerInfo = new Dictionary<int, string>
        {
            { 0, "Player 0" },
            { 1, "Player 1" },
            { 2, "Player 2" },
            { 3, "Player 3" }
        };
        baseUI.LoadTableScene(playerInfo);
        
    }
    //通知Manager牌桌界面已经加载完毕
    public void OnTableSceneLoaded()
    {
        Console.WriteLine("Manager: Table Scene loaded.");
    }

    public void LoadResultsSceneRequested(Dictionary<int, int> finalScores)
    { // 请求加载游戏结果界面的 
        Console.WriteLine("Manager: Loading Results Scene requested.");
        baseUI.LoadResultsScene(finalScores);
    }
    //通知Manager游戏结果界面已经加载完毕
    public void OnResultsSceneLoaded()
    {
        Console.WriteLine("Manager: Results Scene loaded.");
    }

}
}